package com.tech.config

import com.typesafe.config.{Config, ConfigFactory}

/**
 * 加载应用Application属性配置文件config.properties获取属性值
 */
object ApplicationConfig extends Serializable {

  // 加载属性文件,
  private val config: Config = {
    val condition = ConfigFactory.load("active.properties")
    ConfigFactory.load(s"${condition.getString("active.properties")}.properties")
  }

  /*
    Kafka 相关配置信息
  */
  lazy val KAFKA_BROKER_LIST: String = config.getString("kafka.broker.list")
  lazy val KAFKA_STARTING_OFFSETS: String = config.getString("kafka.starting.offsets")
  lazy val KAFKA_MAX_OFFSETS_PER_TRIGGER: String = config.getString("kafka.max.offsets.per.trigger")

  /*
  * kudu 相关配置信息
  * */
  lazy val KUDU_MASTER_ADDRESSES: String = config.getString("kudu.master.addresses")
  lazy val KAFKA_OFFSET_TABLE_NAME: String = config.getString("kafka.offset.table.name")
}
